bitkeeper revision 1.1159.224.6 (41f151cby-4agnF_MdJ_L_DQDJjYbw)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Fri, 21 Jan 2005 19:02:35 +0000 (19:02 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Fri, 21 Jan 2005 19:02:35 +0000 (19:02 +0000)
another manual merge.

xen/arch/x86/domain.c
xen/arch/x86/memory.c
xen/common/domain.c
xen/common/schedule.c
xen/include/xen/domain.h

index 31273080e0b9ecf494d71b0a570570c36bba459e..2ef735843382cec8ff0d21afb8a0b97536962d67 100644 (file)
@@ -226,6 +226,8 @@ void dump_pageframe_info(struct domain *d)
 }
 
 xmem_cache_t *domain_struct_cachep;
+xmem_cache_t *exec_domain_struct_cachep;
+
 void __init domain_startofday(void)
 {
     domain_struct_cachep = xmem_cache_create(
@@ -233,6 +235,12 @@ void __init domain_startofday(void)
         0, SLAB_HWCACHE_ALIGN, NULL, NULL);
     if ( domain_struct_cachep == NULL )
         panic("No slab cache for domain structs.");
+
+    exec_domain_struct_cachep = xmem_cache_create(
+        "exec_dom_cache", sizeof(struct exec_domain),
+        0, SLAB_HWCACHE_ALIGN, NULL, NULL);
+    if ( exec_domain_struct_cachep == NULL )
+        BUG();
 }
 
 struct domain *arch_alloc_domain_struct(void)
@@ -245,6 +253,16 @@ void arch_free_domain_struct(struct domain *d)
     xmem_cache_free(domain_struct_cachep, d);
 }
 
+struct exec_domain *arch_alloc_exec_domain_struct(void)
+{
+    return xmem_cache_alloc(exec_domain_struct_cachep);
+}
+
+void arch_free_exec_domain_struct(struct exec_domain *ed)
+{
+    xmem_cache_free(exec_domain_struct_cachep, ed);
+}
+
 void free_perdomain_pt(struct domain *d)
 {
     free_xenheap_page((unsigned long)d->mm_perdomain_pt);
index f1b22bee001125527fdbd91ecccc936de0e8b29b..739dda8ef2dd640d1c8fc6716d39e5baa392fba7 100644 (file)
@@ -961,7 +961,7 @@ int new_guest_cr3(unsigned long pfn)
     }
     else
     {
-        MEM_LOG("Error while installing new baseptr %08lx", ptr);
+        MEM_LOG("Error while installing new baseptr %08lx", pfn);
     }
 
     return okay;
@@ -1341,7 +1341,7 @@ int do_mmu_update(
 
     LOCK_BIGLOCK(d);
 
-    cleanup_writable_pagetable(d, PTWR_CLEANUP_ACTIVE | PTWR_CLEANUP_INACTIVE);
+    cleanup_writable_pagetable(d);
 
     /*
      * If we are resuming after preemption, read how much work we have already
@@ -1572,7 +1572,7 @@ int do_update_va_mapping(unsigned long page_nr,
 
     LOCK_BIGLOCK(d);
 
-    cleanup_writable_pagetable(d, PTWR_CLEANUP_ACTIVE | PTWR_CLEANUP_INACTIVE);
+    cleanup_writable_pagetable(d);
 
     /*
      * XXX When we make this support 4MB superpages we should also deal with 
index 5366800f29a39abd1dbd79be881f3e5dcfb3cb2e..70f8d0060f100ff4bce85f9d3565956e2e880846 100644 (file)
@@ -354,7 +354,7 @@ long do_boot_vcpu(unsigned long vcpu, full_execution_context_t *ctxt)
  out:
     if ( c != NULL )
         xfree(c);
-    xmem_cache_free(exec_domain_struct_cachep, d->exec_domain[vcpu]);
+    arch_free_exec_domain_struct(d->exec_domain[vcpu]);
     d->exec_domain[vcpu] = NULL;
     return rc;
 }
index 35ae9468a18d9ba1c50ff80c1e717cfc6df6553a..21a1ae25acc392869d451ffb4de8e0b3b8e5804a 100644 (file)
@@ -89,17 +89,14 @@ static struct scheduler ops;
 /* Per-CPU periodic timer sends an event to the currently-executing domain. */
 static struct ac_timer t_timer[NR_CPUS]; 
 
-extern xmem_cache_t *domain_struct_cachep;
-extern xmem_cache_t *exec_domain_struct_cachep;
-
 void free_domain_struct(struct domain *d)
 {
     struct exec_domain *ed;
 
     SCHED_OP(free_task, d);
     for_each_exec_domain(d, ed)
-        xmem_cache_free(exec_domain_struct_cachep, ed);
-    xmem_cache_free(domain_struct_cachep, d);
+        arch_free_exec_domain_struct(ed);
+    arch_free_domain_struct(d);
 }
 
 struct exec_domain *alloc_exec_domain_struct(struct domain *d,
@@ -109,7 +106,7 @@ struct exec_domain *alloc_exec_domain_struct(struct domain *d,
 
     ASSERT( d->exec_domain[vcpu] == NULL );
 
-    if ( (ed = xmem_cache_alloc(exec_domain_struct_cachep)) == NULL )
+    if ( (ed = arch_alloc_exec_domain_struct()) == NULL )
         return NULL;
 
     memset(ed, 0, sizeof(*ed));
@@ -143,7 +140,7 @@ struct exec_domain *alloc_exec_domain_struct(struct domain *d,
 
  out:
     d->exec_domain[vcpu] = NULL;
-    xmem_cache_free(exec_domain_struct_cachep, ed);
+    arch_free_exec_domain_struct(ed);
 
     return NULL;
 }
@@ -152,7 +149,7 @@ struct domain *alloc_domain_struct(void)
 {
     struct domain *d;
 
-    if ( (d = xmem_cache_alloc(domain_struct_cachep)) == NULL )
+    if ( (d = arch_alloc_domain_struct()) == NULL )
         return NULL;
     
     memset(d, 0, sizeof(*d));
@@ -163,7 +160,7 @@ struct domain *alloc_domain_struct(void)
     return d;
 
  out:
-    xmem_cache_free(domain_struct_cachep, d);
+    arch_free_domain_struct(d);
     return NULL;
 }
 
@@ -379,8 +376,7 @@ void __enter_scheduler(void)
     if ( !is_idle_task(current->domain) )
     {
         LOCK_BIGLOCK(current->domain);
-        cleanup_writable_pagetable(
-            prev->domain, PTWR_CLEANUP_ACTIVE | PTWR_CLEANUP_INACTIVE);
+        cleanup_writable_pagetable(prev->domain);
         UNLOCK_BIGLOCK(current->domain);
     }
 
index 4fd86f51f8e30e0ddbbdb26691c66d3e3c031f39..c2d0dbc1448390ed085370fa17cca1b4d7f3c3ff 100644 (file)
@@ -12,7 +12,11 @@ extern struct domain *arch_alloc_domain_struct(void);
 
 extern void arch_free_domain_struct(struct domain *d);
 
-extern void arch_do_createdomain(struct domain *d);
+struct exec_domain *arch_alloc_exec_domain_struct(void);
+
+extern void arch_free_exec_domain_struct(struct exec_domain *ed);
+
+extern void arch_do_createdomain(struct exec_domain *ed);
 
 extern int  arch_final_setup_guestos(
     struct exec_domain *d, full_execution_context_t *c);